package com.aspose.cells;

import java.util.ArrayList;

class zba {
   static Object[][] a(Object[][] var0, WorkbookSettings var1) {
      Object[][] var2 = new Object[var0.length][];

      for(int var3 = 0; var3 < var0.length; ++var3) {
         if (var0[var3] != null) {
            var2[var3] = new Object[var0[var3].length];

            for(int var4 = 0; var4 < var0[var3].length; ++var4) {
               var2[var3][var4] = zbc.b(var0[var3][var4], var1);
            }
         }
      }

      return var2;
   }

   static boolean a(byte[] var0, byte[] var1) {
      if (var0.length != var1.length) {
         return false;
      } else {
         for(int var2 = 0; var2 < var0.length; ++var2) {
            if (var0[var2] != var1[var2]) {
               return false;
            }
         }

         return true;
      }
   }

   static Object[] a(Object[] var0) {
      int var1 = 1;
      int var2 = 1;
      boolean var3 = true;

      for(int var4 = 0; var4 < var0.length; ++var4) {
         if (var0[var4] != null && var0[var4] instanceof Object[][]) {
            Object[][] var5 = (Object[][])((Object[][])var0[var4]);
            if (var5.length > var1) {
               var1 = var5.length;
               if (var4 != 0) {
                  var3 = false;
               }
            } else if (var5.length < var1 && var4 != 0) {
               var3 = false;
            }

            if (var5[0].length > var2) {
               var2 = var5[0].length;
               if (var4 != 0) {
                  var3 = false;
               }
            } else if (var5[0].length < var2 && var4 != 0) {
               var3 = false;
            }
         }
      }

      if (var3) {
         return var0;
      } else {
         Object[] var12 = new Object[var0.length];

         for(int var13 = 0; var13 < var0.length; ++var13) {
            if (var0[var13] != null) {
               Object[][] var6 = new Object[var1][];
               int var8;
               if (var0[var13] instanceof Object[][]) {
                  Object[][] var7 = (Object[][])((Object[][])var0[var13]);
                  var8 = var7.length;
                  int var9 = var7[0].length;
                  int var10;
                  int var11;
                  if (var8 == 1) {
                     if (var9 == 1) {
                        for(var10 = 0; var10 < var1; ++var10) {
                           var6[var10] = new Object[var2];

                           for(var11 = 0; var11 < var2; ++var11) {
                              var6[var10][var11] = var7[0][0];
                           }
                        }
                     } else {
                        for(var10 = 0; var10 < var1; ++var10) {
                           var6[var10] = new Object[var2];

                           for(var11 = 0; var11 < var9; ++var11) {
                              var6[var10][var11] = var7[0][var11];
                           }

                           if (var9 < var2) {
                              for(var11 = var9; var11 < var2; ++var11) {
                                 ;
                              }
                           }
                        }
                     }
                  } else if (var9 == 1) {
                     for(var10 = 0; var10 < var1; ++var10) {
                        var6[var10] = new Object[var2];
                        if (var10 < var8) {
                           if (var7[var10] != null) {
                              for(var11 = 0; var11 < var2; ++var11) {
                                 var6[var10][var11] = var7[var10][0];
                              }
                           }
                        } else {
                           for(var11 = 0; var11 < var2; ++var11) {
                              ;
                           }
                        }
                     }
                  } else if (var8 == var1 && var9 == var2) {
                     var6 = var7;
                  } else {
                     for(var10 = 0; var10 < var1; ++var10) {
                        var6[var10] = new Object[var2];
                        if (var10 >= var8) {
                           for(var11 = 0; var11 < var2; ++var11) {
                              ;
                           }
                        } else {
                           if (var7[var10] != null) {
                              for(var11 = 0; var11 < var7[var10].length; ++var11) {
                                 var6[var10][var11] = var7[var10][var11];
                              }
                           }

                           if (var9 < var2) {
                              for(var11 = var9; var11 < var2; ++var11) {
                                 ;
                              }
                           }
                        }
                     }
                  }
               } else {
                  for(int var14 = 0; var14 < var1; ++var14) {
                     var6[var14] = new Object[var2];

                     for(var8 = 0; var8 < var2; ++var8) {
                        var6[var14][var8] = var0[var13];
                     }
                  }
               }

               var12[var13] = var6;
            }
         }

         return var12;
      }
   }

   static Object a(Workbook var0, Object var1, Object var2, boolean var3) {
      Object[] var4 = new Object[]{var1};
      Object[] var5 = new Object[]{var2};
      zye.a(var4, var5);
      var1 = var4[0];
      var2 = var5[0];
      Object[] var6 = (Object[])((Object[])var1);
      Object[] var7 = (Object[])((Object[])var2);
      Object[][] var8 = new Object[var6.length][];
      int var9 = 0;

      for(int var10 = 0; var10 < var6.length; ++var10) {
         Object[] var11 = (Object[])((Object[])var6[var10]);
         Object[] var12 = (Object[])((Object[])var7[var10]);
         if (var10 == 0) {
            var9 = var11.length;
         }

         var8[var10] = new Object[var9];

         for(int var13 = 0; var13 < var9; ++var13) {
            var8[var10][var13] = zbc.a(var0, var11 == null ? 0.0D : com.aspose.cells.b.a.za.a(var11, var13), var12 == null ? 0.0D : com.aspose.cells.b.a.za.a(var12, var13), var3);
         }
      }

      return var8;
   }

   static Object a(Workbook var0, Object var1, Object var2) {
      Object[] var3 = new Object[]{var1};
      Object[] var4 = new Object[]{var2};
      zye.a(var3, var4);
      var1 = var3[0];
      var2 = var4[0];
      Object[] var5 = (Object[])((Object[])var1);
      Object[] var6 = (Object[])((Object[])var2);
      Object[][] var7 = new Object[var5.length][];
      int var8 = 0;

      for(int var9 = 0; var9 < var5.length; ++var9) {
         Object[] var10 = (Object[])((Object[])var5[var9]);
         Object[] var11 = (Object[])((Object[])var6[var9]);
         if (var10 != null && var11 != null) {
            if (var9 == 0) {
               var8 = var10.length;
            }

            var7[var9] = new Object[var8];

            for(int var12 = 0; var12 < var8; ++var12) {
               var7[var9][var12] = zbc.a(var0, com.aspose.cells.b.a.za.a(var10, var12), var11 == null ? 0.0D : com.aspose.cells.b.a.za.a(var11, var12));
            }
         }
      }

      return var7;
   }

   static Object b(Workbook var0, Object var1, Object var2) {
      Object[] var3 = new Object[]{var1};
      Object[] var4 = new Object[]{var2};
      zye.a(var3, var4);
      var1 = var3[0];
      var2 = var4[0];
      Object[] var5 = (Object[])((Object[])var1);
      Object[] var6 = (Object[])((Object[])var2);

      for(int var7 = 0; var7 < var5.length; ++var7) {
         Object[] var8 = (Object[])((Object[])var5[var7]);
         Object[] var9 = (Object[])((Object[])var6[var7]);
         if (var8 != null && var9 != null) {
            for(int var10 = 0; var10 < var8.length; ++var10) {
               com.aspose.cells.b.a.za.a(var8, zbc.b(var0, com.aspose.cells.b.a.za.a(var8, var10), com.aspose.cells.b.a.za.a(var9, var10)), var10);
            }

            var5[var7] = var8;
         }
      }

      return var5;
   }

   static Object c(Workbook var0, Object var1, Object var2) {
      Object[] var3 = new Object[]{var1};
      Object[] var4 = new Object[]{var2};
      zye.a(var3, var4);
      var1 = var3[0];
      var2 = var4[0];
      Object[] var5 = (Object[])((Object[])var1);
      Object[] var6 = (Object[])((Object[])var2);
      Object[][] var7 = new Object[var5.length][];

      for(int var8 = 0; var8 < var5.length; ++var8) {
         Object[] var9 = (Object[])((Object[])var5[var8]);
         Object[] var10 = (Object[])((Object[])var6[var8]);
         if (var9 != null && var10 != null) {
            var7[var8] = new Object[var9.length];

            for(int var11 = 0; var11 < var9.length; ++var11) {
               var7[var8][var11] = zbc.d(var0, com.aspose.cells.b.a.za.a(var9, var11), com.aspose.cells.b.a.za.a(var10, var11));
            }
         }
      }

      return var7;
   }

   static Object a(Object[] var0, Object[] var1) {
      Object[][] var2 = new Object[var0.length][];

      for(int var3 = 0; var3 < var0.length; ++var3) {
         Object var4 = com.aspose.cells.b.a.za.a(var0, var3);
         if (var4 == null) {
            var2[var3] = new Object[]{com.aspose.cells.b.a.zr.a(com.aspose.cells.b.a.za.a(var1, var3))};
         } else if (var4 instanceof Object[]) {
            Object[] var10 = (Object[])((Object[])var4);
            Object[] var6 = (Object[])((Object[])com.aspose.cells.b.a.za.a(var1, var3));
            var2[var3] = new Object[var6.length];

            for(int var7 = 0; var7 < var10.length; ++var7) {
               Object var8 = com.aspose.cells.b.a.za.a(var10, var7);
               if (var8 == null) {
                  var8 = "";
               }

               Object var9 = com.aspose.cells.b.a.za.a(var6, var7);
               if (var9 == null) {
                  var9 = "";
               }

               var2[var3][var7] = com.aspose.cells.b.a.zr.a(var8) + com.aspose.cells.b.a.zr.a(var9);
            }
         } else {
            Object var5 = com.aspose.cells.b.a.za.a(var1, var3);
            if (var5 == null) {
               var2[var3] = new Object[]{com.aspose.cells.b.a.zr.a(var4)};
            } else {
               var2[var3] = new Object[]{com.aspose.cells.b.a.zr.a(var4) + com.aspose.cells.b.a.zr.a(var5)};
            }
         }
      }

      return var2;
   }

   static Object a(Object[] var0, Object var1) {
      Object[][] var2 = new Object[var0.length][];

      for(int var3 = 0; var3 < var0.length; ++var3) {
         Object var4 = com.aspose.cells.b.a.za.a(var0, var3);
         if (var4 == null) {
            var2[var3] = new Object[]{com.aspose.cells.b.a.zr.a(var1)};
         } else if (var4 instanceof Object[]) {
            Object[] var5 = (Object[])((Object[])var4);
            var2[var3] = new Object[var5.length];

            for(int var6 = 0; var6 < var5.length; ++var6) {
               Object var7 = com.aspose.cells.b.a.za.a((Object[])var5, 0);
               if (var7 == null) {
                  var7 = "";
               }

               Object var8 = var1;
               if (var1 == null) {
                  var8 = "";
               }

               var2[var3][var6] = com.aspose.cells.b.a.zr.a(var7) + com.aspose.cells.b.a.zr.a(var8);
            }
         }
      }

      return var2;
   }

   static Object d(Workbook var0, Object var1, Object var2) {
      if (!(var1 instanceof Object[][]) && !(var2 instanceof Object[][])) {
         return zbc.c(var0, var1, var2);
      } else {
         Object[][] var9;
         if (var1 instanceof Object[][]) {
            if (var2 instanceof Object[][]) {
               var9 = (Object[][])((Object[][])var2);
               Object[][] var10 = zye.a((Object[][])((Object[][])var1));

               for(int var11 = 0; var11 < var10.length; ++var11) {
                  Object[] var12 = (Object[])var10[var11];
                  if (var12 != null) {
                     Object[] var13 = (Object[])var9[var11];

                     for(int var8 = 0; var8 < var12.length; ++var8) {
                        var12[var8] = zbc.c(var0, var12[var8], var13[var8]);
                     }
                  }
               }

               return var10;
            }

            Object var3 = var1;
            var1 = var2;
            var2 = var3;
         }

         var9 = zye.a((Object[][])((Object[][])var2));

         for(int var4 = 0; var4 < var9.length; ++var4) {
            Object[] var5 = (Object[])var9[var4];
            if (var5 != null) {
               for(int var6 = 0; var6 < var5.length; ++var6) {
                  Object var7 = var5[var6];
                  if (var7 != null) {
                     var5[var6] = zbc.c(var0, var1, var7);
                  }
               }
            }
         }

         return var9;
      }
   }

   static Object a(Workbook var0, Object var1) {
      Object[] var2 = (Object[])((Object[])var1);
      Object[][] var3 = new Object[var2.length][];
      Object var4 = com.aspose.cells.b.a.za.a((Object[])var2, 0);
      int var5;
      if (com.aspose.cells.a.c.zc.a(var4)) {
         var5 = ((Object[])((Object[])var4)).length;

         for(int var6 = 0; var6 < var2.length; ++var6) {
            var3[var6] = new Object[var5];
            var4 = com.aspose.cells.b.a.za.a(var2, var6);
            if (var4 == null) {
               for(int var9 = 0; var9 < var5; ++var9) {
                  var3[var6][var9] = true;
               }
            } else {
               Object[] var7 = (Object[])((Object[])var4);

               for(int var8 = 0; var8 < var5; ++var8) {
                  var3[var6][var8] = zbc.a(var0, com.aspose.cells.b.a.za.a(var7, var8));
               }
            }
         }
      } else {
         for(var5 = 0; var5 < var2.length; ++var5) {
            var3[var5] = new Object[1];
            var3[var5][0] = zbc.a(var0, com.aspose.cells.b.a.za.a(var2, var5));
         }
      }

      return var3;
   }

   static Object a(Object var0) {
      Object[] var1 = (Object[])((Object[])var0);
      Object[][] var2 = new Object[var1.length][];
      int var3 = 0;

      for(int var4 = 0; var4 < var1.length; ++var4) {
         if (com.aspose.cells.b.a.za.a(var1, var4) != null) {
            Object[] var5 = (Object[])((Object[])com.aspose.cells.b.a.za.a(var1, var4));
            if (var4 == 0) {
               var3 = var5.length;
            }

            var2[var4] = new Object[var3];

            for(int var6 = 0; var6 < var5.length; ++var6) {
               if (com.aspose.cells.b.a.za.a(var5, var6) == null) {
                  var2[var4][var6] = false;
               } else {
                  switch(zamo.a(com.aspose.cells.b.a.za.a(var5, var6).getClass())) {
                  case 14:
                  case 16:
                     var2[var4][var6] = true;
                     break;
                  default:
                     var2[var4][var6] = false;
                  }
               }
            }
         }
      }

      return var2;
   }

   static Object b(Workbook var0, Object var1) {
      Object[][] var2 = (Object[][])null;
      int var4;
      if (var1 instanceof double[][]) {
         double[][] var9 = (double[][])((double[][])var1);
         var4 = var9[0].length;
         var2 = new Object[var9.length][];

         for(int var10 = 0; var10 < 0; ++var10) {
            if (var9[var10] != null) {
               var2[var10] = new Object[var4];

               for(int var11 = 0; var11 < var9[var10].length; ++var11) {
                  var2[var10][var11] = Math.abs(var9[var10][var11]);
               }
            }
         }

         return var2;
      } else {
         Object[] var3 = (Object[])((Object[])var1);
         var2 = new Object[var3.length][];

         for(var4 = 0; var4 < var3.length; ++var4) {
            Object var5 = com.aspose.cells.b.a.za.a(var3, var4);
            if (var5 != null) {
               Object[] var6 = (Object[])((Object[])var5);
               var2[var4] = new Object[var6.length];

               for(int var7 = 0; var7 < var6.length; ++var7) {
                  Object var8 = zbc.a(com.aspose.cells.b.a.za.a(var6, var7), var0.getSettings());
                  if (var8 instanceof zst) {
                     return var8;
                  }

                  var2[var4][var7] = var8;
               }
            }
         }

         return var2;
      }
   }

   static boolean b(Object[] var0, Object[] var1) {
      if (var0.length != var1.length) {
         return false;
      } else {
         Object[] var2 = (Object[])((Object[])com.aspose.cells.b.a.za.a((Object[])var0, 0));
         Object[] var3 = (Object[])((Object[])com.aspose.cells.b.a.za.a((Object[])var1, 0));
         return var2.length == var3.length;
      }
   }

   static Object a(Workbook var0, Object[] var1, Object[] var2, ArrayList var3, ArrayList var4) {
      int var5 = ((Object[])((Object[])com.aspose.cells.b.a.za.a((Object[])var1, 0))).length;

      for(int var6 = 0; var6 < var1.length; ++var6) {
         Object[] var7 = (Object[])((Object[])com.aspose.cells.b.a.za.a(var1, var6));
         Object[] var8 = (Object[])((Object[])com.aspose.cells.b.a.za.a(var2, var6));

         for(int var9 = 0; var9 < var5; ++var9) {
            Object var10 = com.aspose.cells.b.a.za.a(var7, var9);
            Object var11 = com.aspose.cells.b.a.za.a(var8, var9);
            if (var10 != null && var11 != null) {
               if (var10 instanceof zst) {
                  return var10;
               }

               if (var11 instanceof zst) {
                  return var11;
               }

               switch(zamo.a(var10.getClass())) {
               case 14:
                  switch(zamo.a(var11.getClass())) {
                  case 14:
                     com.aspose.cells.b.a.a.ze.a(var3, var10);
                     com.aspose.cells.b.a.a.ze.a(var4, var11);
                     continue;
                  case 16:
                     com.aspose.cells.b.a.a.ze.a(var3, var10);
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)CellsHelper.getDoubleFromDateTime((DateTime)var11, var0.getSettings().getDate1904()));
                  default:
                     continue;
                  }
               case 16:
                  switch(zamo.a(var11.getClass())) {
                  case 14:
                     com.aspose.cells.b.a.a.ze.a(var3, (Object)CellsHelper.getDoubleFromDateTime((DateTime)var10, var0.getSettings().getDate1904()));
                     com.aspose.cells.b.a.a.ze.a(var4, var11);
                     break;
                  case 16:
                     com.aspose.cells.b.a.a.ze.a(var3, (Object)CellsHelper.getDoubleFromDateTime((DateTime)var10, var0.getSettings().getDate1904()));
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)CellsHelper.getDoubleFromDateTime((DateTime)var11, var0.getSettings().getDate1904()));
                  }
               }
            }
         }
      }

      return null;
   }

   static int b(Object var0) {
      int var1 = 0;
      Object[] var2 = (Object[])((Object[])var0);
      Object[] var3 = (Object[])((Object[])com.aspose.cells.b.a.za.a((Object[])var2, 0));
      int var4 = var3.length;

      for(int var5 = 0; var5 < var2.length; ++var5) {
         var3 = (Object[])((Object[])com.aspose.cells.b.a.za.a(var2, var5));
         if (var3 == null) {
            var1 += var4;
         } else {
            for(int var6 = 0; var6 < var3.length; ++var6) {
               Object var7 = com.aspose.cells.b.a.za.a(var3, var6);
               if (var7 == null) {
                  ++var1;
               } else if (var7 instanceof String && ((String)var7).length() == 0) {
                  ++var1;
               }
            }
         }
      }

      return var1;
   }

   static int c(Object var0) {
      int var1 = 0;
      Object[] var2 = (Object[])((Object[])var0);

      for(int var3 = 0; var3 < var2.length; ++var3) {
         Object var4 = com.aspose.cells.b.a.za.a(var2, var3);
         if (var4 instanceof Object[]) {
            Object[] var5 = (Object[])((Object[])var4);

            for(int var6 = 0; var6 < var5.length; ++var6) {
               var4 = com.aspose.cells.b.a.za.a(var5, var6);
               if (var4 instanceof Double) {
                  ++var1;
               }
            }
         } else if (var4 instanceof Double) {
            ++var1;
         }
      }

      return var1;
   }

   static Object a(Object var0, boolean var1) {
      Object[][] var2 = (Object[][])null;
      int var4;
      int var5;
      if (var0 instanceof double[][]) {
         double[][] var6 = (double[][])((double[][])var0);
         var2 = new Object[var6.length][];

         for(var4 = 0; var4 < var6.length; ++var4) {
            if (var6[var4] != null) {
               var2[var4] = new Object[var6[var4].length];

               for(var5 = 0; var5 < var6[var4].length; ++var5) {
                  var2[var4][var5] = zyn.d(var6[var4][var5], var1);
               }
            }
         }

         return var2;
      } else if (!(var0 instanceof Object[][])) {
         return zst.i;
      } else {
         Object[][] var3 = (Object[][])((Object[][])var0);
         var2 = new Object[var3.length][];

         for(var4 = 0; var4 < var3.length; ++var4) {
            if (var3[var4] != null) {
               var2[var4] = new Object[var3[var4].length];

               for(var5 = 0; var5 < var3[var4].length; ++var5) {
                  var2[var4][var5] = zyn.d(var3[var4][var5], var1);
               }
            }
         }

         return var2;
      }
   }

   static int d(Object var0) {
      int var1 = 0;
      if (var0 instanceof Object[]) {
         Object[] var2 = (Object[])((Object[])var0);

         for(int var3 = 0; var3 < var2.length; ++var3) {
            Object var4 = com.aspose.cells.b.a.za.a(var2, var3);
            if (var4 instanceof Object[]) {
               Object[] var5 = (Object[])((Object[])var4);

               for(int var6 = 0; var6 < var5.length; ++var6) {
                  var4 = com.aspose.cells.b.a.za.a(var5, var6);
                  if (var4 != null) {
                     ++var1;
                  }
               }
            } else if (var4 instanceof Double) {
               ++var1;
            }
         }
      }

      return var1;
   }

   static Object a(Object[][] var0, Object var1, Workbook var2, int var3) {
      Object[][] var4 = new Object[var0.length][];
      int var5 = var0[0].length;

      for(int var6 = 0; var6 < var0.length; ++var6) {
         var4[var6] = new Object[var5];

         for(int var7 = 0; var7 < var5; ++var7) {
            switch(var3) {
            case -1:
               var4[var6][var7] = zbc.a(var0[var6][var7], var1, var2);
               break;
            case 0:
               var4[var6][var7] = zbc.b(var0[var6][var7], var1, var2);
               break;
            case 1:
               var4[var6][var7] = zbc.c(var0[var6][var7], var1, var2);
            }
         }
      }

      return var4;
   }

   static Object a(Object var0, Object var1, WorkbookSettings var2) {
      Object[][] var3;
      int var5;
      int var8;
      if (var0 instanceof Object[][]) {
         var3 = (Object[][])null;
         if (var1 instanceof Object[][]) {
            Object[] var10 = a(new Object[]{var0, var1});
            var0 = var10[0];
            var1 = var10[1];
            var3 = (Object[][])((Object[][])var1);
         }

         Object[][] var11 = (Object[][])((Object[][])var0);
         var5 = var11.length;
         int var12 = var11[0].length;
         Object[][] var13 = new Object[var5][];

         for(var8 = 0; var8 < var5; ++var8) {
            var13[var8] = new Object[var12];

            for(int var9 = 0; var9 < var12; ++var9) {
               var13[var8][var9] = zbc.a(var11[var8] == null ? null : var11[var8][var9], var3 == null ? var1 : (var3[var8] == null ? null : var3[var8][var9]), var2);
            }
         }

         return var13;
      } else {
         var3 = (Object[][])((Object[][])var1);
         int var4 = var3.length;
         var5 = var3[0].length;
         Object[][] var6 = new Object[var4][];

         for(int var7 = 0; var7 < var4; ++var7) {
            var6[var7] = new Object[var5];

            for(var8 = 0; var8 < var5; ++var8) {
               var6[var7][var8] = zbc.a(var0, var3[var7] == null ? null : var3[var7][var8], var2);
            }
         }

         return var6;
      }
   }
}
